package cn.kgc.mes.saleline.service.impl;

import java.util.List;
import cn.kgc.mes.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.kgc.mes.saleline.mapper.ProductSalseLineMapper;
import cn.kgc.mes.saleline.domain.ProductSalseLine;
import cn.kgc.mes.saleline.service.IProductSalseLineService;

/**
 * 产品销售出库行Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-21
 */
@Service
public class ProductSalseLineServiceImpl extends ServiceImpl<ProductSalseLineMapper, ProductSalseLine> implements IProductSalseLineService
{
    @Autowired
    private ProductSalseLineMapper productSalseLineMapper;

    /**
     * 查询产品销售出库行
     * 
     * @param lineId 产品销售出库行主键
     * @return 产品销售出库行
     */
    @Override
    public ProductSalseLine selectProductSalseLineByLineId(Long lineId)
    {
        return productSalseLineMapper.selectProductSalseLineByLineId(lineId);
    }

    /**
     * 查询产品销售出库行列表
     * 
     * @param productSalseLine 产品销售出库行
     * @return 产品销售出库行
     */
    @Override
    public List<ProductSalseLine> selectProductSalseLineList(ProductSalseLine productSalseLine)
    {
        return productSalseLineMapper.selectProductSalseLineList(productSalseLine);
    }

    /**
     * 新增产品销售出库行
     * 
     * @param productSalseLine 产品销售出库行
     * @return 结果
     */
    @Override
    public int insertProductSalseLine(ProductSalseLine productSalseLine)
    {
        productSalseLine.setCreateTime(DateUtils.getNowDate());
        return productSalseLineMapper.insertProductSalseLine(productSalseLine);
    }

    /**
     * 修改产品销售出库行
     * 
     * @param productSalseLine 产品销售出库行
     * @return 结果
     */
    @Override
    public int updateProductSalseLine(ProductSalseLine productSalseLine)
    {
        productSalseLine.setUpdateTime(DateUtils.getNowDate());
        return productSalseLineMapper.updateProductSalseLine(productSalseLine);
    }

    /**
     * 批量删除产品销售出库行
     * 
     * @param lineIds 需要删除的产品销售出库行主键
     * @return 结果
     */
    @Override
    public int deleteProductSalseLineByLineIds(Long[] lineIds)
    {
        return productSalseLineMapper.deleteProductSalseLineByLineIds(lineIds);
    }

    /**
     * 删除产品销售出库行信息
     * 
     * @param lineId 产品销售出库行主键
     * @return 结果
     */
    @Override
    public int deleteProductSalseLineByLineId(Long lineId)
    {
        return productSalseLineMapper.deleteProductSalseLineByLineId(lineId);
    }
}
